import java.util.*;


public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        String[] str=new String[n];
        Set<String> set=new HashSet<>();
        for(int i=0;i<n;i++){
            str[i]=in.next();
            char[] ch=str[i].toCharArray();
            Arrays.sort(ch);
            StringBuilder s=new StringBuilder();
            for(int j=0;j<ch.length;j++){
                s.append(ch[j]);
            }
            set.add(s.toString());
        }
        System.out.println(set.size());
    }
    /**
     * 打怪
     * @param args
     */
    public static void main2(String[] args){
        Scanner in=new Scanner(System.in);
        int t=in.nextInt();
        int cnt=0;
        while(cnt<t){
            int h=in.nextInt();
            int a=in.nextInt();
            int H=in.nextInt();
            int A=in.nextInt();
            int count=0;
            if(a>=H){
                System.out.println(-1);
            }else{
                while(h>0){
                    int num=H;
                    while(num>0&&h>0){
                        num-=a;
                        if(num<=0){
                            break;
                        }
                        h-=A;
                    }
                    if(h>0) {
                        count++;
                    }
                }
                System.out.println(count);
            }

            cnt++;
        }
    }
    /**
     * 最长回文子序列
     * @param args
     */
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        char[] s=in.next().toCharArray();
        int n=s.length;
        int[][] dp=new int[n][n];
        for(int i=n-1;i>=0;i--){
            dp[i][i]=1;
            for(int j=i+1;j<n;j++){
                if(s[i]==s[j]){
                    dp[i][j]=dp[i+1][j-1]+2;
                }else{
                    dp[i][j]=Math.max(dp[i+1][j],dp[i][j-1]);
                }
            }
        }
        System.out.println(dp[0][n-1]);
    }
}